

            function addArduinoCod (Blockly) {
            
                        

                        
        Blockly.Arduino['EXT_DC_MOTOR_BLOCK_1607595094041'] = function(block)
        {
            let pin_a = this.getFieldValue('pin_a');
let pin_b = this.getFieldValue('pin_b');
let tr = this.getFieldValue('tr');
let speed =  Blockly.Arduino.valueToCode(this, 'speed', Blockly.Arduino.ORDER_ATOMIC);
          
            Blockly.Arduino.definitions_['include_EXT_DC_MOTOR_BLOCK_1607595094041'] = ``;
            Blockly.Arduino.definitions_['define_EXT_DC_MOTOR_BLOCK_1607595094041'] = `#define INA${pin_a} ${pin_a}\r\n#define INB${pin_b} ${pin_b}\r\n\r\nvoid Motor_Drives (int tr,int speed) {\r\n    if (tr == 0) {\r\n        analogWrite(INA${pin_a}, speed);\r\n        analogWrite(INB${pin_b},0);\r\n    } else if (tr == 1) {\r\n        analogWrite(INA${pin_a},0);\r\n        analogWrite(INB${pin_b}, speed);\r\n    }\r\n}`;
            Blockly.Arduino.definitions_['setup_EXT_DC_MOTOR_BLOCK_1607595094041'] = `pinMode(INA${pin_a}, OUTPUT);\r\n  pinMode(INB${pin_b}, OUTPUT);`;
             return  `Motor_Drives (${tr},${speed});\r\n`;
        }
                    
            return Blockly;
            }

            module.exports = addArduinoCod ;

        